package com.xywy.bloodandroid.act;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.xywy.bloodandroid.R;
import com.xywy.bloodandroid.base.BaseActivity;

/**
 * 关于当前app
 */
public class AboutAcitivty extends BaseActivity {

	private TextView middle_title; // title
	private RelativeLayout left_img; // left button
	private LinearLayout ll_soure; // soure button
	private LinearLayout ll_feed; // feed button

	@Override
	protected void initView(Bundle savedInstanceState) {
		setContentView(R.layout.activity_about);
		middle_title = (TextView) findViewById(R.id.middle_title);
		middle_title.setText("关于血压卫士");
		left_img = (RelativeLayout) findViewById(R.id.left_img);
		ll_soure = (LinearLayout) findViewById(R.id.ll_soure);
		ll_feed = (LinearLayout) findViewById(R.id.ll_feed);

	}

	@Override
	protected void initListener() {
		left_img.setOnClickListener(this);
		ll_soure.setOnClickListener(this);
		ll_feed.setOnClickListener(this);
	}

	@Override
	protected void initData() {

	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		super.onClick(v);
		switch (v.getId()) {
		case R.id.left_img:
			AboutAcitivty.this.finish();
			break;
		case R.id.ll_soure:
			// showToast("去评分");
			clickPingfen();

			break;
		case R.id.ll_feed:
			enterActivity(FeedBackActivity.class);
			break;
		}
	}

	private void clickPingfen() {
		// TODO Auto-generated method stub
		Uri uri = Uri.parse("market://details?id=" + getPackageName());
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		startActivity(intent);
	}

}
